package com.study.spring;

import com.study.spring.configuraproperties.Car;
import com.study.spring.kafka.Consumer;
import com.study.spring.kafka.Producer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationBeanNameGenerator;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;


/**
 *
 * @see com.study.spring.Application
 */

@EnableCaching
@ComponentScan(nameGenerator = AnnotationBeanNameGenerator.class)
@EnableAsync
@EnableRetry
@SpringBootApplication
//@MapperScan("com.study.spring.*")
public class Application {

    public static void main(String[] args) {


//        SpringApplication springApplication = new SpringApplication(Application.class);
//        springApplication.setBanner(new ResourceBanner(new ClassPathResource("banner.txt")));
//
//        springApplication.setBannerMode(Banner.Mode.CONSOLE);
//        springApplication.run(args);
//

//        new SpringApplication().

        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);

            // 更改默认配置文件
//        new SpringApplicationBuilder().properties()
        for (String beanDefinitionName : run.getBeanDefinitionNames()) {
            System.out.println(beanDefinitionName);
        }

        System.out.println("============");
        System.out.println(run.getBean("car", Car.class));

    }

}
